home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt3sp4.arc / SETPARMA.PAS < prev    next >
Pascal/Delphi Source File  |  1985-10-06  |  27KB  |  611 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                Set_Params --- Set Communications Parameters          *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. OVERLAY FUNCTION Set_Params( First_Time : BOOLEAN;
  6.                              Use_Script : BOOLEAN ) : BOOLEAN;
  7.  
  8. (*----------------------------------------------------------------------*)
  9. (*                                                                      *)
  10. (*     Function:  Set_Params                                            *)
  11. (*                                                                      *)
  12. (*     Purpose:    Set communications parameters                        *)
  13. (*                                                                      *)
  14. (*     Calling Sequence:                                                *)
  15. (*                                                                      *)
  16. (*        Flag := Set_Params( First_Time : BOOLEAN;                     *)
  17. (*                            Use_Script : BOOLEAN ) : BOOLEAN;         *)
  18. (*                                                                      *)
  19. (*           First_Time:  TRUE for initial setup, else FALSE.           *)
  20. (*           Use_Script:  TRUE to use commands from script buffer       *)
  21. (*                                                                      *)
  22. (*           Flag is TRUE if successful set-up, else FALSE.             *)
  23. (*                                                                      *)
  24. (*      Calls:   ClrScr                                                 *)
  25. (*               Async_Init                                             *)
  26. (*               Async_Open                                             *)
  27. (*               Get_Params                                             *)
  28. (*                                                                      *)
  29. (*----------------------------------------------------------------------*)
  30.  
  31. VAR                                (* Hold new colors/video mode *)
  32.    New_Text_Mode        : INTEGER;
  33.    New_ForeGround_Color : INTEGER;
  34.    New_BackGround_Color : INTEGER;
  35.    New_Menu_Text_Color  : INTEGER;
  36.    New_Menu_Frame_Color : INTEGER;
  37.    Review_Buffer_Length : INTEGER;
  38.  
  39. CONST
  40.    Max_Param_Names = 63;
  41.  
  42. (* STRUCTURED *) CONST
  43.    Param_Names : ARRAY[ 1 .. Max_Param_Names ] OF STRING[2] =
  44.                  ( 'DA', 'PA', 'ST', 'BA', 'PO', 'BS', 'DE', 'TE', 'AG',
  45.                    'LF', 'MI', 'MD', 'MC', 'MN', 'MB', 'ME', 'MT', 'MH',
  46.                    'MO', 'MR', 'SM', 'PM', 'LE', 'FC', 'FD', 'FW', 'TT',
  47.                    'SD', 'GD', 'TB', 'MA', 'MS', 'FM', 'TM', 'CF', 'CB',
  48.                    'CT', 'CM', 'MW', 'BP', 'EB', 'DP', 'BB', 'XM', 'CH',
  49.                    'XB', 'AB', 'VB', 'VF', 'VE', 'VU', 'KC', 'KD', 'KE',
  50.                    'KH', 'KN', 'KP', 'KQ', 'KR', 'KS', 'KT', 'KW', 'K8' );
  51.  
  52.    Trans_Type_Name : ARRAY[ Transfer_Type ] OF STRING[2] =
  53.                      ( 'AS', 'XK', 'XC', 'KE', 'TE', 'MK',
  54.                        'M7', 'YM', 'YB', 'NO' );
  55.  
  56.    Trans_Type      : ARRAY[ 1 .. Max_Transfer_Types ] OF Transfer_Type =
  57.                      ( Ascii, Xmodem_Chk, Xmodem_Crc, Kermit, Telink,
  58.                        Modem7_Chk, Modem7_CRC, Ymodem, Ymodem_Batch, None );
  59.  
  60. (*----------------------------------------------------------------------*)
  61. (*    Write_Config_File --- Write updated PibTerm configuration file    *)
  62. (*----------------------------------------------------------------------*)
  63.  
  64. PROCEDURE Write_Config_File;
  65.  
  66. (*----------------------------------------------------------------------*)
  67. (*                                                                      *)
  68. (*     Procedure:  Write_Config_File                                    *)
  69. (*                                                                      *)
  70. (*     Purpose:    Writes updated parameters to PibTerm config. file    *)
  71. (*                                                                      *)
  72. (*     Calling Sequence:                                                *)
  73. (*                                                                      *)
  74. (*        Write_Config_File;                                            *)
  75. (*                                                                      *)
  76. (*      Calls:   None                                                   *)
  77. (*                                                                      *)
  78. (*----------------------------------------------------------------------*)
  79.  
  80. BEGIN (* Write_Config_File *)
  81.  
  82.    ASSIGN( Config_File, Home_Dir + 'PIBTERM.CNF' );
  83.              (*$I-*)
  84.    REWRITE( Config_File );
  85.              (*$I+*)
  86.  
  87.    IF Int24Result <> 0 THEN
  88.       BEGIN
  89.          WRITELN;
  90.          WRITELN('Can''t create new PIBTERM.CNF.');
  91.       END
  92.    ELSE
  93.       BEGIN  (* Write configuration file *)
  94.  
  95.          WRITELN( Config_File , 'FC=', FK_CR                         );
  96.          WRITELN( Config_File , 'FD=', FK_Delay                      );
  97.          WRITELN( Config_File , 'FW=', FK_Wait_For                   );
  98.          WRITELN( Config_File , 'FM=', FK_Ctrl_Mark                  );
  99.          WRITELN( ConFig_File , 'DA=', Data_Bits                     );
  100.          WRITELN( ConFig_File , 'PA=', Parity                        );
  101.          WRITELN( Config_File , 'ST=', Stop_Bits                     );
  102.          WRITELN( Config_File , 'BA=', Baud_Rate                     );
  103.          WRITELN( Config_File , 'PO=', Comm_Port                     );
  104.          WRITELN( Config_File , 'BS=', ORD( BS_Char )                );
  105.          WRITELN( Config_File , 'DE=', ORD( Ctrl_BS_Char )           );
  106.          WRITELN( Config_File , 'TE=', ORD( Terminal_To_Emulate )    );
  107.          WRITELN( Config_File , 'AG=', ORD( Ansi_Graphics_On )       );
  108.          WRITELN( Config_File , 'LF=', ORD( Add_LF )                 );
  109.          WRITELN( Config_File , 'MI=', Write_Ctrls( Modem_Init )     );
  110.          WRITELN( Config_File , 'MD=', Write_Ctrls( Modem_Dial )     );
  111.          WRITELN( Config_File , 'MC=', Modem_Connect                 );
  112.          WRITELN( Config_File , 'MN=', Modem_No_Carrier              );
  113.          WRITELN( Config_File , 'MB=', Modem_Busy                    );
  114.          WRITELN( Config_File , 'ME=', Write_Ctrls( Modem_Escape)    );
  115.          WRITELN( Config_File , 'MT=', Modem_Escape_Time             );
  116.          WRITELN( Config_File , 'MH=', Write_Ctrls( Modem_Hang_Up)   );
  117.          WRITELN( Config_File , 'MO=', Modem_Time_Out:4:0            );
  118.          WRITELN( Config_File , 'MR=', Modem_Redial_Delay:4:0        );
  119.          WRITELN( Config_File , 'MA=', Write_Ctrls( Modem_Answer )   );
  120.          WRITELN( Config_File , 'MS=', Write_Ctrls( Modem_Host_Set ) );
  121.          WRITELN( Config_File , 'MW=', Modem_Command_Delay           );
  122.          WRITELN( Config_File , 'SM=', ORD( Silent_Mode )            );
  123.          WRITELN( Config_File , 'PM=', ORD( Play_Music_On )          );
  124.          WRITELN( Config_File , 'LE=', ORD( Local_Echo )             );
  125.          WRITELN( Config_File , 'TT=', Trans_Type_Name[ Default_Transfer_Type ] );
  126.          WRITELN( Config_File , 'SD=', Screen_Dump_Name              );
  127.          WRITELN( Config_File , 'GD=', GMT_Difference                );
  128.          WRITELN( Config_File , 'TB=', Transfer_Bells                );
  129.  
  130.          IF New_Text_Mode = BW80 THEN
  131.             WRITELN( Config_File , 'TM=M' )
  132.          ELSE
  133.             WRITELN( Config_File , 'TM=C' );
  134.  
  135.          WRITELN( Config_File , 'CF=', New_ForeGround_Color          );
  136.          WRITELN( Config_File , 'CB=', New_BackGround_Color          );
  137.          WRITELN( Config_File , 'CT=', New_Menu_Text_Color           );
  138.          WRITELN( Config_File , 'CM=', New_Menu_Frame_Color          );
  139.          WRITELN( Config_File , 'BP=', ORD( CompuServe_B_On )        );
  140.          WRITELN( Config_File , 'EB=', ORD( Mahoney_On )             );
  141.          WRITELN( Config_File , 'DP=', Default_Prefix                );
  142.          WRITELN( Config_File , 'BB=', Max_Review_Length             );
  143.          WRITELN( Config_File , 'XM=', ORD( Exploding_Menus )        );
  144.          WRITELN( Config_File , 'CH=', ORD( Modem_Carrier_High )     );
  145.          WRITELN( Config_File , 'XB=', Max_Write_Buffer              );
  146.          WRITELN( Config_File , 'AB=', ORD( Host_Auto_Baud )         );
  147.          WRITELN( Config_File , 'VB=', VT100_BackGround_Color        );
  148.          WRITELN( Config_File , 'VF=', VT100_ForeGround_Color        );
  149.          WRITELN( Config_File , 'VE=', VT100_Bold_Color              );
  150.          WRITELN( Config_File , 'VU=', VT100_Underline_Color         );
  151.          WRITELN( Config_File , 'KC=', Kermit_Chk_Type               );
  152.          WRITELN( Config_File , 'KD=', ORD( Kermit_Debug )           );
  153.          WRITELN( Config_File , 'KE=', Write_Ctrls( Kermit_EOL )     );
  154.          WRITELN( Config_File , 'KH=', Write_Ctrls( Kermit_Header_Char ) );
  155.          WRITELN( Config_File , 'KN=', Kermit_Npad                   );
  156.          WRITELN( Config_File , 'KP=', Write_Ctrls( Kermit_Pad_Char ) );
  157.          WRITELN( Config_File , 'KQ=', Write_Ctrls( Kermit_Quote_Char ) );
  158.          WRITELN( Config_File , 'KR=', Write_Ctrls( Kermit_Repeat_Char ) );
  159.          WRITELN( Config_File , 'KS=', Kermit_Packet_Size            );
  160.          WRITELN( Config_File , 'KT=', Kermit_TimeOut                );
  161.          WRITELN( Config_File , 'KW=', Kermit_Delay_Time             );
  162.          WRITELN( Config_File , 'K8=', Write_Ctrls( Kermit_Quote_8_Char ) );
  163.  
  164.    END   (* Write configuration file *);
  165.  
  166.    CLOSE( Config_File );
  167.  
  168. END   (* Write_Config_File *);
  169.  
  170. (*----------------------------------------------------------------------*)
  171. (*         Set_Parameter --- Set value of PibTerm parameter             *)
  172. (*----------------------------------------------------------------------*)
  173.  
  174. PROCEDURE Set_Parameter( Param_Num  : INTEGER;
  175.                          Param_Ival : INTEGER;
  176.                          Param_Rval : REAL;
  177.                          Param_Str  : AnyStr   );
  178.  
  179. (*----------------------------------------------------------------------*)
  180. (*                                                                      *)
  181. (*     Procedure:  Set_Parameter                                        *)
  182. (*                                                                      *)
  183. (*     Purpose:    Set value of PibTerm parameter                       *)
  184. (*                                                                      *)
  185. (*     Calling Sequence:                                                *)
  186. (*                                                                      *)
  187. (*        Set_Parameter( Param_Num  : INTEGER;                          *)
  188. (*                       Param_Ival : INTEGER;                          *)
  189. (*                       Param_Rval : REAL;                             *)
  190. (*                       Param_Str  : AnyStr   );                       *)
  191. (*                                                                      *)
  192. (*           Param_Num  --- Parameter to set                            *)
  193. (*           Param_Ival --- integer parameter value                     *)
  194. (*           Param_Rval --- real parameter value                        *)
  195. (*           Param_Str  --- string parameter value                      *)
  196. (*                                                                      *)
  197. (*----------------------------------------------------------------------*)
  198.  
  199. VAR
  200.    I : INTEGER;
  201.  
  202. BEGIN (* Set_Parameter *)
  203.  
  204.    CASE Param_Num OF
  205.  
  206.        0 :  ;
  207.  
  208.        1 :  Data_Bits     := Param_Ival;
  209.        2 :  Parity        := Param_Str[1];
  210.        3 :  Stop_Bits     := Param_Ival;
  211.        4 :  Baud_Rate     := Param_Ival;
  212.        5 :  Comm_Port     := Param_Ival;
  213.        6 :  BS_Char       := CHR( Param_Ival );
  214.        7 :  Ctrl_BS_Char  := CHR( Param_Ival );
  215.        8 :  CASE Param_Ival OF
  216.                0:     Terminal_To_Emulate := Dumb;
  217.                1:     Terminal_To_Emulate := VT52;
  218.                2:     Terminal_To_Emulate := Ansi;
  219.                3:     Terminal_To_Emulate := VT100;
  220.                4:     Terminal_To_Emulate := Gossip;
  221.                5:     Terminal_To_Emulate := HostMode;
  222.                ELSE   Terminal_To_Emulate := Dumb;
  223.             END (* CASE *);
  224.        9 :  Ansi_Graphics_On   := ( Param_Ival = 1 );
  225.       10 :  Add_Lf             := ( Param_Ival = 1 );
  226.       11 :  Modem_Init         := Read_Ctrls( Param_Str );
  227.       12 :  Modem_Dial         := Read_Ctrls( Param_Str );
  228.       13 :  Modem_Connect      := Param_Str;
  229.       14 :  Modem_No_Carrier   := Param_Str;
  230.       15 :  Modem_Busy         := Param_Str;
  231.       16 :  Modem_Escape       := Read_Ctrls( Param_Str );
  232.       17 :  Modem_Escape_Time  := Param_Ival;
  233.       18 :  Modem_Hang_Up      := Read_Ctrls( Param_Str );
  234.       19 :  Modem_Time_Out     := Param_Rval;
  235.       20 :  Modem_Redial_Delay := Param_Rval;
  236.       21 :  Silent_Mode        := ( Param_Ival = 1 );
  237.       22 :  Play_Music_On      := ( Param_Ival = 1 );
  238.       23 :  Local_Echo         := ( Param_Ival = 1 );
  239.       24 :  FK_CR              := Param_Str[1];
  240.       25 :  FK_Delay           := Param_Str[1];
  241.       26 :  FK_Wait_For        := Param_Str[1];
  242.       27 :  FOR I := 1 TO Max_Transfer_Types DO
  243.                IF ( COPY( Param_Str, 1, 2 ) =
  244.                   Trans_Type_Name[Trans_Type[I]] ) THEN
  245.                      Default_Transfer_Type := Trans_Type[I];
  246.       28 :  Screen_Dump_Name   := Param_Str;
  247.       29 :  GMT_Difference     := Param_Ival;
  248.       30 :  Transfer_Bells     := Param_Ival;
  249.       31 :  Modem_Answer       := Read_Ctrls( Param_Str );
  250.       32 :  Modem_Host_Set     := Read_Ctrls( Param_Str );
  251.       33 :  FK_Ctrl_Mark       := Param_Str[1];
  252.       34 :  CASE Param_Str[1] OF
  253.                'C': New_Text_Mode   := C80;
  254.                'M': New_Text_Mode   := BW80;
  255.                ELSE New_Text_Mode   := BW80;
  256.             END;
  257.       35 :  New_ForeGround_Color   := Param_Ival;
  258.       36 :  New_BackGround_Color   := Param_Ival;
  259.       37 :  New_Menu_Text_Color    := Param_Ival;
  260.       38 :  New_Menu_Frame_Color   := Param_Ival;
  261.       39 :  Modem_Command_Delay    := Param_Ival;
  262.       40 :  CompuServe_B_On        := ( Param_Ival = 1 );
  263.       41 :  Mahoney_On             := ( Param_Ival = 1 );
  264.       42 :  Default_Prefix         := Param_Str[1];
  265.       43 :  Max_Review_Length      := MIN( MAX( Param_Ival , 0 ) , 800 );
  266.       44 :  Exploding_Menus        := ( Param_Ival = 1 );
  267.       45 :  Modem_Carrier_High     := ( Param_Ival = 1 );
  268.       46 :  Max_Write_Buffer       := MAX( ( ( Param_Ival + 127 ) DIV 128 ) * 128 ,
  269.                                            128 );
  270.       47 :  Host_Auto_Baud         := ( Param_Ival = 1 );
  271.       48 :  VT100_BackGround_Color := Param_Ival;
  272.       49 :  VT100_ForeGround_Color := Param_Ival;
  273.       50 :  VT100_Bold_Color       := Param_Ival;
  274.       51 :  VT100_Underline_Color  := Param_Ival;
  275.       52 :  Kermit_Chk_Type        := Param_Str[1];
  276.       53 :  Kermit_Debug           := ( Param_Ival = 1 );
  277.       54 :  Kermit_EOL             := COPY( Read_Ctrls( Param_Str ), 1, 1 );
  278.       55 :  Kermit_Header_Char     := COPY( Read_Ctrls( Param_Str ), 1, 1 ) ;
  279.       56 :  Kermit_Npad            := MAX( Param_Ival , 0 );
  280.       57 :  Kermit_Pad_Char        := COPY( Read_Ctrls( Param_Str ), 1, 1 );
  281.       58 :  Kermit_Quote_Char      := COPY( Read_Ctrls( Param_Str ), 1, 1 );
  282.       59 :  Kermit_Repeat_Char     := COPY( Read_Ctrls( Param_Str ), 1, 1 );
  283.       60 :  Kermit_Packet_Size     := MIN( MAX( Param_Ival , 20 ) , 94 );
  284.       61 :  Kermit_TimeOut         := Param_Ival;
  285.       62 :  Kermit_Delay_Time      := Param_Ival;
  286.       63 :  Kermit_Quote_8_Char    := COPY( Read_Ctrls( Param_Str ), 1, 1 );
  287.  
  288.       ELSE ;
  289.  
  290.    END (* CASE *);
  291.  
  292.    IF Silent_Mode THEN Play_Music_On := FALSE;
  293.    Menu_Set_Explode( Exploding_Menus );
  294.  
  295. END   (* Set_Parameter *);
  296.  
  297. (*----------------------------------------------------------------------*)
  298. (*        Set_Defaults --- Set Default Communications Parameters        *)
  299. (*----------------------------------------------------------------------*)
  300.  
  301. OVERLAY PROCEDURE Set_Defaults;
  302.  
  303. (*----------------------------------------------------------------------*)
  304. (*                                                                      *)
  305. (*     Procedure:  Set_Defaults                                         *)
  306. (*                                                                      *)
  307. (*     Purpose:    Set default communications parameters                *)
  308. (*                                                                      *)
  309. (*     Calling Sequence:                                                *)
  310. (*                                                                      *)
  311. (*        Set_Defaults;                                                 *)
  312. (*                                                                      *)
  313. (*      Calls:   None                                                   *)
  314. (*                                                                      *)
  315. (*      Remarks:  Note that defaults for color-related variables are    *)
  316. (*                set in PibTerm so that error messages will appear     *)
  317. (*                in a readable form.                                   *)
  318. (*                                                                      *)
  319. (*----------------------------------------------------------------------*)
  320.  
  321. VAR
  322.    I: INTEGER;
  323.    J: INTEGER;
  324.  
  325. BEGIN (* Set_Defaults *)
  326.  
  327.    Data_Bits           := 8;
  328.    Parity              := 'N';
  329.    Stop_Bits           := 1;
  330.    Baud_Rate           := 2400;
  331.    Comm_Port           := 1;
  332.  
  333.    BS_Char             := CHR( BS );
  334.    Ctrl_BS_Char        := CHR( DEL );
  335.  
  336.    Terminal_To_Emulate := Dumb;
  337.  
  338.    Ansi_Graphics_On    := FALSE;
  339.    Add_LF              := FALSE;
  340.    Capture_On          := FALSE;
  341.    Printer_On          := FALSE;
  342.    Translate_On        := FALSE;
  343.    Play_Music_On       := TRUE;
  344.    Silent_Mode         := FALSE;
  345.    Local_Echo          := FALSE;
  346.  
  347.    Modem_Init          := 'ATX3|';
  348.    Modem_Dial          := 'ATDT';
  349.    Modem_Connect       := 'CONNECT';
  350.    Modem_No_Carrier    := 'NO CARRIER';
  351.    Modem_Busy          := 'BUSY';
  352.    Modem_Time_Out      := 60.0;
  353.    Modem_Redial_Delay  := 45.0;
  354.    Modem_Escape        := '+++';
  355.    Modem_Escape_Time   := 1500;
  356.    Modem_Hang_Up       := 'ATH0|';
  357.    Modem_Answer        := 'ATA|';
  358.    Modem_Host_Set      := 'ATZ|~ATX1|~ATS0=1|';
  359.    Modem_Command_Delay := 0;
  360.  
  361.    Host_Auto_Baud      := TRUE;
  362.  
  363.    Script_String       := '';
  364.    Script_String_2     := '';
  365.  
  366.    Max_Write_Buffer    := 2048;
  367.  
  368.    Default_Transfer_Type := Xmodem_Chk;
  369.    Default_Prefix        := '+';
  370.  
  371.    Phone_Entry_Page    := 1;
  372.  
  373.    FOR I := 1 TO 4 DO
  374.       FOR J := 1 TO 10 DO
  375.          Function_Keys[I,J] := '';
  376.  
  377.    FK_CR        := '|';
  378.    FK_Delay     := '~';
  379.    FK_Wait_For  := '`';
  380.    FK_Ctrl_Mark := '^';
  381.  
  382.    FOR I := 0 TO 255 DO
  383.       BEGIN
  384.          TrTab[ CHR( I ) ]     := CHR( I );
  385.          Keypad_Key_Index[ I ] := 0;
  386.       END;
  387.  
  388.    Screen_Dump_Name := '';
  389.  
  390.    GMT_Difference   := 0;
  391.    Transfer_Bells   := 8;
  392.  
  393.    CompuServe_B_On   := FALSE;
  394.    Mahoney_On        := TRUE;
  395.    Exploding_Menus   := FALSE;
  396.  
  397.    Review_On         := FALSE;
  398.    Max_Review_Length := 0;
  399.    Review_Buffer     := NIL;
  400.    Review_Head       := 0;
  401.    Review_Tail       := 0;
  402.    Review_Line       := '';
  403.  
  404.    FOR I := 1 TO 3 DO
  405.       FOR J := 1 TO 10 DO
  406.          Keypad_Keys[I,J] := '';
  407.  
  408.    Keypad_Key_Index[U_Arrow]      := 1;
  409.    Keypad_Key_Index[Alt_U_Arrow]  := 11;
  410.    Keypad_Key_Index[Ctrl_U_Arrow] := 21;
  411.  
  412.    Keypad_Key_Index[L_Arrow]      := 2;
  413.    Keypad_Key_Index[Alt_L_Arrow]  := 12;
  414.    Keypad_Key_Index[Ctrl_L_Arrow] := 22;
  415.  
  416.    Keypad_Key_Index[R_Arrow]      := 3;
  417.    Keypad_Key_Index[Alt_R_Arrow]  := 13;
  418.    Keypad_Key_Index[Ctrl_R_Arrow] := 23;
  419.  
  420.    Keypad_Key_Index[D_Arrow]      := 4;
  421.    Keypad_Key_Index[Alt_D_Arrow]  := 14;
  422.    Keypad_Key_Index[Ctrl_D_Arrow] := 24;
  423.  
  424.    Keypad_Key_Index[Home]         := 5;
  425.    Keypad_Key_Index[Alt_Home]     := 15;
  426.  
  427.    Keypad_Key_Index[PgUp]         := 6;
  428.    Keypad_Key_Index[Alt_PgUp]     := 16;
  429.    Keypad_Key_Index[Ctrl_PgUp]    := 26;
  430.  
  431.    Keypad_Key_Index[End_Key]      := 7;
  432.    Keypad_Key_Index[Alt_End_Key]  := 17;
  433.    Keypad_Key_Index[Ctrl_End_Key] := 27;
  434.  
  435.    Keypad_Key_Index[PgDn]         := 8;
  436.    Keypad_Key_Index[Alt_PgDn]     := 18;
  437.    Keypad_Key_Index[Ctrl_PgDn]    := 28;
  438.  
  439.    Keypad_Key_Index[Ins_Key]      := 9;
  440.    Keypad_Key_Index[Alt_Ins_Key]  := 19;
  441.    Keypad_Key_Index[Ctrl_Ins_Key] := 29;
  442.  
  443.    Keypad_Key_Index[Del_Key]      := 10;
  444.    Keypad_Key_Index[Alt_Del_Key]  := 20;
  445.    Keypad_Key_Index[Ctrl_Del_Key] := 30;
  446.  
  447.    Keypad_Key_Names[1,1]  := 'K8';
  448.    Keypad_Key_Names[2,1]  := 'AK8';
  449.    Keypad_Key_Names[3,1]  := 'CK8';
  450.  
  451.    Keypad_Key_Names[1,2]  := 'K4';
  452.    Keypad_Key_Names[2,2]  := 'AK4';
  453.    Keypad_Key_Names[3,2]  := 'CK4';
  454.  
  455.    Keypad_Key_Names[1,3]  := 'K6';
  456.    Keypad_Key_Names[2,3]  := 'AK6';
  457.    Keypad_Key_Names[3,3]  := 'CK6';
  458.  
  459.    Keypad_Key_Names[1,4]  := 'K2';
  460.    Keypad_Key_Names[2,4]  := 'AK2';
  461.    Keypad_Key_Names[3,4]  := 'CK2';
  462.  
  463.    Keypad_Key_Names[1,5]  := 'K7';
  464.    Keypad_Key_Names[2,5]  := 'AK7';
  465.    Keypad_Key_Names[3,5]  := '';
  466.  
  467.    Keypad_Key_Names[1,6]  := 'K9';
  468.    Keypad_Key_Names[2,6]  := 'AK9';
  469.    Keypad_Key_Names[3,6]  := 'CK9';
  470.  
  471.    Keypad_Key_Names[1,7]  := 'K1';
  472.    Keypad_Key_Names[2,7]  := 'AK1';
  473.    Keypad_Key_Names[3,7]  := 'CK1';
  474.  
  475.    Keypad_Key_Names[1,8]  := 'K3';
  476.    Keypad_Key_Names[2,8]  := 'AK3';
  477.    Keypad_Key_Names[3,8]  := 'CK3';
  478.  
  479.    Keypad_Key_Names[1,9]  := 'K0';
  480.    Keypad_Key_Names[2,9]  := 'AK0';
  481.    Keypad_Key_Names[3,9]  := 'CK0';
  482.  
  483.    Keypad_Key_Names[1,10] := 'K.';
  484.    Keypad_Key_Names[2,10] := 'AK.';
  485.    Keypad_Key_Names[3,10] := 'CK.';
  486.  
  487.                                    (* Initialize command table *)
  488.    FOR I := 0 TO 255 DO
  489.       Pibterm_Command_Table[I] := Null_Command;
  490.  
  491.    PibTerm_Command_Table[Alt_A] := EditSy;
  492.    PibTerm_Command_Table[Alt_B] := BreakSy;
  493.    PibTerm_Command_Table[Alt_C] := ClearSy;
  494.    PibTerm_Command_Table[Alt_D] := DialSy;
  495.    PibTerm_Command_Table[Alt_E] := EchoSy;
  496.    PibTerm_Command_Table[Alt_F] := FileSy;
  497.    PibTerm_Command_Table[Alt_G] := GossipSy;
  498.    PibTerm_Command_Table[Alt_H] := HangUpSy;
  499.    PibTerm_Command_Table[Alt_I] := InfoSy;
  500.    PibTerm_Command_Table[Alt_J] := DosSy;
  501.    PibTerm_Command_Table[Alt_K] := KeySy;
  502.    PibTerm_Command_Table[Alt_L] := LogSy;
  503.    PibTerm_Command_Table[Alt_M] := MuteSy;
  504.    PibTerm_Command_Table[Alt_N] := FastCSy;
  505.    PibTerm_Command_Table[Alt_O] := CaptureSy;
  506.    PibTerm_Command_Table[Alt_P] := ParamSy;
  507.    PibTerm_Command_Table[Alt_Q] := RedialSy;
  508.    PibTerm_Command_Table[Alt_R] := ReceiveSy;
  509.    PibTerm_Command_Table[Alt_S] := SendSy;
  510.    PibTerm_Command_Table[Alt_T] := TranslateSy;
  511.    PibTerm_Command_Table[Alt_U] := SDumpSy;
  512.    PibTerm_Command_Table[Alt_V] := ViewSy;
  513.    PibTerm_Command_Table[Alt_W] := HostSy;
  514.    PibTerm_Command_Table[Alt_X] := QuitSy;
  515.    PibTerm_Command_Table[Alt_Y] := TimersSy;
  516.    PibTerm_Command_Table[Alt_Z] := AreaCodeSy;
  517.  
  518.    PibTerm_Command_Table[Shift_Tab] := AddLfSy;
  519.  
  520.    FOR I := F1 TO F10 DO
  521.       PibTerm_Command_Table[I] := KeySendSy;
  522.  
  523.    FOR I := Alt_F1 TO Alt_F10 DO
  524.       PibTerm_Command_Table[I] := KeySendSy;
  525.  
  526.    FOR I := Shift_F1 TO Shift_F10 DO
  527.       PibTerm_Command_Table[I] := KeySendSy;
  528.  
  529.    FOR I := Ctrl_F1 TO Ctrl_F10 DO
  530.       PibTerm_Command_Table[I] := KeySendSy;
  531.  
  532.    PibTerm_Command_Table[U_Arrow]      := KeySendSy;
  533.    PibTerm_Command_Table[Alt_U_Arrow]  := KeySendSy;
  534.    PibTerm_Command_Table[Ctrl_U_Arrow] := KeySendSy;
  535.  
  536.    PibTerm_Command_Table[L_Arrow]      := KeySendSy;
  537.    PibTerm_Command_Table[Alt_L_Arrow]  := KeySendSy;
  538.    PibTerm_Command_Table[Ctrl_L_Arrow] := KeySendSy;
  539.  
  540.    PibTerm_Command_Table[R_Arrow]      := KeySendSy;
  541.    PibTerm_Command_Table[Alt_R_Arrow]  := KeySendSy;
  542.    PibTerm_Command_Table[Ctrl_R_Arrow] := KeySendSy;
  543.  
  544.    PibTerm_Command_Table[D_Arrow]      := KeySendSy;
  545.    PibTerm_Command_Table[Alt_D_Arrow]  := KeySendSy;
  546.    PibTerm_Command_Table[Ctrl_D_Arrow] := KeySendSy;
  547.  
  548.    PibTerm_Command_Table[Home]         := KeySendSy;
  549.    PibTerm_Command_Table[Alt_Home]     := KeySendSy;
  550.  
  551.    PibTerm_Command_Table[PgUp]         := KeySendSy;
  552.    PibTerm_Command_Table[Alt_PgUp]     := KeySendSy;
  553.    PibTerm_Command_Table[Ctrl_PgUp]    := KeySendSy;
  554.  
  555.    PibTerm_Command_Table[End_Key]      := KeySendSy;
  556.    PibTerm_Command_Table[Alt_End_Key]  := KeySendSy;
  557.    PibTerm_Command_Table[Ctrl_End_Key] := KeySendSy;
  558.  
  559.    PibTerm_Command_Table[PgDn]         := KeySendSy;
  560.    PibTerm_Command_Table[Alt_PgDn]     := KeySendSy;
  561.    PibTerm_Command_Table[Ctrl_PgDn]    := KeySendSy;
  562.  
  563.    PibTerm_Command_Table[Ins_Key]      := KeySendSy;
  564.    PibTerm_Command_Table[Alt_Ins_Key]  := KeySendSy;
  565.    PibTerm_Command_Table[Ctrl_Ins_Key] := KeySendSy;
  566.  
  567.    PibTerm_Command_Table[Del_Key]      := KeySendSy;
  568.    PibTerm_Command_Table[Alt_Del_Key]  := KeySendSy;
  569.    PibTerm_Command_Table[Ctrl_Del_Key] := KeySendSy;
  570.  
  571.                                    (* Initialize Kermit variables *)
  572.  
  573.                                    (* Timeout value *)
  574.    Kermit_Timeout      := 5;
  575.                                    (* Default checksum method *)
  576.    Kermit_Chk_Type     := '1';
  577.                                    (* Marks repeated data *)
  578.    Kermit_Repeat_Char  := '~';
  579.                                    (* But repeating not implemented yet *)
  580.    Repeating           := FALSE;
  581.                                    (* Time to wait before send in host mode *)
  582.    Kermit_Delay_Time   := 15;
  583.                                    (* Initial packet size *)
  584.  
  585.    Kermit_Packet_Size  := Kermit_Init_Packet_Size;
  586.  
  587.                                    (* Padding not required *)
  588.    Kermit_Npad         := 0;
  589.    Kermit_Pad_Char     := CHR( 0 );
  590.  
  591.                                    (* Don't send padding unless requested *)
  592.    My_Pad_Num          := 0;
  593.                                    (* CR is initial EOL *)
  594.  
  595.    Kermit_EOL          := CHR( CR );
  596.  
  597.                                    (* Send a CR to start with *)
  598.    Send_EOL            := CR;
  599.                                    (* Use the default quote *)
  600.    Kermit_Quote_Char   := '#';
  601.                                    (* Use the default 8 bit quote *)
  602.    Kermit_Quote_8_Char := '&';
  603.                                    (* But don't ask for it unless binary with parity *)
  604.    Quoting             := FALSE;
  605.                                    (* No debugging in Kermit *)
  606.    Kermit_Debug        := FALSE;
  607.                                    (* SOH is default header character *)
  608.    Kermit_Header_Char  := CHR( SOH );
  609.  
  610. END   (* Set_Defaults *);
  611.